<template>
  <div class="app-container">
    <el-row :gutter="20">
      <div class="filter-container">
        <el-col :span="4">
          <el-col :span="1">
            <i :class="[treeShow ? 'el-icon-s-fold treeI': 'el-icon-s-unfold treeI']" @click="toggerTree" />
          </el-col>
        </el-col>
        <el-col style="text-align:right;margin-top: -8px;margin-bottom:10px" :span="20">
          <el-button
            size="small"
            class="filter-item"
            style="margin-left: 10px;"
            type="primary"
            @click="handleQuery"
          >
            额度刷新
          </el-button>
          <el-button
            size="small"
            font-size="14px"
            class="filter-item"
            style="margin-left: 10px;"
            type="primary"
            @click="handleHookUp"
          >
            指标挂接
          </el-button>
        </el-col>
      </div>
    </el-row>
    <div class="grid-content bg-purple" />
    <div
      ref="box"
      class="box"
    >
      <div
        class="left"
        :class="[isActive ? 'wid':'wids']"
      >
        <div
          :class="[treeShow ? 'treeShow' : 'treeNotShow']"
          :style="{'height' : treeHeight + 'px'}"
        >
          <AgencyTree class="agencyTree" @handleTreeQuery="handleTreeQuery" @getFirstAuthAgencyData="getFirstAuthAgencyData" />
        </div>
      </div>
      <div
        v-show="Show"
        class="resize"
        title="收缩侧边栏"
      />
      <div
        class="mid"
        :class="[isActive ? 'mids': 'min']"
      >
        <!-- 表格部分 -->
        <el-table
          ref="singalTable"
          v-loading="listLoading"
          :data="list"
          :stripe="true"
          :height="tableHeight"
          fit
          style="width: 100%;  margin-left:10px"
          :header-cell-style="{background:'#eef1f6',color:'#606266'}"
        >
          <template slot="empty">
            <tableEmpty />
          </template>
          <el-table-column type="selection" align="center" width="50" />
          <el-table-column type="index" align="center" width="50" label="序号" />
          <el-table-column label="工资项名称" prop="salaryBaseName" align="center" />
          <el-table-column label="工资项类别" prop="personStateName" align="center" />
<!--          <el-table-column label="状态" align="center">-->
<!--            <template slot-scope="{row}">-->
<!--              <span>{{ row.isUsing | usingFilter() }}</span>-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--          <el-table-column label="指标ID" prop="bgtId" align="center" />-->
<!--          <el-table-column label="指标文号" prop="corBgtDocNoName" align="center" />-->
          <el-table-column label="指标总额" align="center">
            <template slot-scope="{row}">
              <span style="float: right">{{ Number(row.aviamt).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,") }}</span>
            </template>
          </el-table-column>
          <el-table-column label="指标可用金额" align="center">
            <template slot-scope="{row}">
              <span style="float: right">{{ Number(row.canuseamt).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,") }}</span>
            </template>
          </el-table-column>
<!--          <el-table-column label="支付方式" prop="payTypeName" align="center" />-->
<!--          <el-table-column label="资金性质" prop="fundTypeName" align="center" />-->
<!--          <el-table-column label="年度" prop="year" align="center" />-->
          <el-table-column label="单位编码" prop="agency_code" align="center" />
          <el-table-column label="单位名称" prop="agencyName" align="center" />
        </el-table>
        <pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
      </div>
    </div>
    <Drag ref="icon" />
    <!-- 指标挂接 -->
    <el-dialog  v-dialogDrag   title="指标挂接" :visible.sync="hookUpFormVisible" width="70%" :close-on-click-modal="false">
      <el-form ref="hookUpForm" :model="formData" label-position="right" label-width="120px" size="small">
        <el-row>
          <el-col>
            <span style="font-weight: 600">指标筛选规则：</span>
          </el-col>
        </el-row>
        <el-row style="border: 1px solid #f2f2f2; margin-top: 1%">
          <!-- <el-col :span="5.5">
            <el-form-item label="项目分类" style="background-color: #f2f2f2" />
            <el-select v-model="formData.proCatCode" class="filter-item" clearable placeholder="--请选择--" style="width:100%">
              <el-option v-for="item in proCatLists" :key="item.code" :label="item.name" :value="item.code" />
            </el-select>
          </el-col> -->
          <el-col :span="5.5">
            <el-form-item label="预算项目" style="background-color: #f2f2f2" />
            <el-input v-model="formData.proCode" maxlength="100" clearable/>
          </el-col>
           <el-col :span="5.5">
            <el-form-item label="指标文号" style="background-color: #f2f2f2" />
            <el-input v-model="formData.corBgtDocNoName" maxlength="100" clearable/>
          </el-col>
          <el-col :span="5.5">
            <el-form-item label="支付方式" style="background-color: #f2f2f2" />
            <el-select v-model="formData.payTypeCode" class="filter-item" clearable placeholder="--请选择--" style="width:100%">
              <el-option v-for="item in payTypeLists" :key="item.code" :label="item.name" :value="item.code" />
            </el-select>
          </el-col>
          <el-col :span="5.5">
                <el-form-item label="支出功能科目" style="background-color: #f2f2f2" />
                <el-select ref="selectReport" v-model="funcName" class="filter-item" clearable placeholder="--请选择--" style="width:100%" @clear="clearFuncHandle">
                  <el-option :value="formData.funcCode" :label="funcName" style="height:200px;overflow: auto;background-color:#fff">
                    <el-tree
                      :data="funcLists"
                      :accordion="true"
                      :highlight-current="true"
                      :props="defaultProps"
                      :node-key="defaultProps.id"
                      :default-expanded-keys="defaultExpandedKey"
                      @node-click="handleFuncNodeClick"
                    />
                  </el-option>
                </el-select>
              </el-col>
          <el-col :span="5.5">
            <el-form-item label="经济分类" style="background-color: #f2f2f2" />
            <el-select ref="selectReport" v-model="depBgtEcoName" class="filter-item" clearable placeholder="--请选择--" style="width:100%" @clear="clearHandle">
              <el-option :value="formData.depBgtEcoCode" :label="depBgtEcoName" style="height:200px;overflow: auto;background-color:#fff">
                <el-tree
                  :data="depBgtEcoLists"
                  :accordion="true"
                  :highlight-current="true"
                  :props="defaultProps"
                  :node-key="defaultProps.id"
                  :default-expanded-keys="defaultExpandedKey"
                  @node-click="handleNodeClick"
                />
              </el-option>
            </el-select>
          </el-col>
          <el-col :span="5.5">
            <el-form-item label="支出类别" style="background-color: #f2f2f2" />
            <el-select ref="selectPayReport" v-model="payCategoryName" class="filter-item" clearable style="width:100%"  @clear="clearPayHandle">
              <el-option :value="formData.payCategoryCode" :label="payCategoryName" style="height:200px;overflow: auto;background-color:#fff">
                <el-tree
                  :data="payCategoryLists"
                  :accordion="true"
                  :highlight-current="true"
                  :props="defaultProps"
                  :node-key="defaultProps.id"
                  :default-expanded-keys="defaultPayExpandedKey"
                  @node-click="handlePayNodeClick"
                />
              </el-option>
            </el-select>
          </el-col>
        </el-row>
        <el-row style="margin-top: 2%">
          <el-col>
            <el-button
              size="small"
              class="filter-item"
              style="margin-left: 10px;"
              type="primary"
              @click="handleQueryIndexList"
            >
              查询
            </el-button>
          </el-col>
        </el-row>
        <el-row style="margin-top: 2%">
          <el-col>
            <span>请选择挂接的指标：</span>
          </el-col>
        </el-row>
        <el-row>
          <el-col>
            <el-table
              ref="indexTable"
              v-loading="indexLoading"
              :data="indexList"
              :stripe="true"
              fit
              style="width: 100%;  margin-left:10px"
              height="300px"

              :header-cell-style="{background:'#eef1f6',color:'#606266'}"
              @select="handleIndexChecked"
              @select-all="handleAllChecked"
            >
              <template slot="empty">
                <tableEmpty />
              </template>
              <el-table-column type="selection" align="center" width="50" />
              <el-table-column label="指标ID" prop="bgtId" align="center" />
              <el-table-column label="指标总金额" width="120" align="center">
                <template slot-scope="{row}">
                  <span style="float: right">{{ Number(row.aviamt).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,") }}</span>
                </template>
              </el-table-column>
              <el-table-column label="剩余指标" width="120" align="center">
                <template slot-scope="{row}">
                  <span style="float: right">{{ Number(row.canuseamt).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,") }}</span>
                </template>
              </el-table-column>
              <el-table-column label="支付方式" prop="payTypeName" width="120" align="center" />
              <el-table-column label="功能分类编码" prop="expFuncCode" width="120" align="center" />
              <el-table-column label="功能分类名称" prop="expFuncName" width="120" align="center" />
              <el-table-column label="指标文号" prop="corBgtDocNoName" width="120" align="center" />
              <el-table-column label="资金性质" prop="fundTypeName" width="120" align="center" />
              <el-table-column label="预算项目" prop="proName" width="120" align="center" />
              <el-table-column label="单位编码" prop="agency_code" width="120" align="center" />
              <el-table-column label="单位名称" prop="agencyName" width="120" align="center" />
              <el-table-column label="经济分类编码" prop="depBgtEcoNo" width="120" align="center" />
              <el-table-column label="经济分类名称" prop="depBgtEcoName" width="120" align="center" />
              <el-table-column label="支出类别" prop="pay_category_name" width="120" align="center" />
            </el-table>
            <pagination :total="indexTotal" :page.sync="formData.offset" :limit.sync="formData.limit" @pagination="getIndexList" />
          </el-col>
        </el-row>
        <el-row style="margin-top: 2%">
          <el-col>
            <span>已挂接的指标：</span>
          </el-col>
        </el-row>
        <el-row>
          <el-col>
            <el-table
              ref="hookUpTable"
              v-loading="hookUpLoading"
              :data="hookUpList"
              :stripe="true"
              fit
              class="hookUpTable"
              style="width: 100%;  margin-left:10px"
              height="300px"
              :header-cell-style="{background:'#eef1f6',color:'#606266'}"
            >
              <template slot="empty">
                <tableEmpty />
              </template>
              <el-table-column label="扣除顺序" prop="payOrder" align="center" width="170" fixed>
                <template slot-scope="{row}">
                  <el-input-number v-model="row.payOrder" :min="1" :max="999" class="cell-input" />
                </template>
              </el-table-column>
              <el-table-column label="状态" prop="isUsing" align="center" width="100" fixed>
                <template slot-scope="{row}">
                  <div class="input-box">
                    <el-select v-model="row.isUsing" class="filter-item" placeholder="--请选择--" style="width:100%">
                      <el-option v-for="item in usingList" :key="item.code" :label="item.name" :value="item.code" />
                    </el-select>
                  </div>
                </template>
              </el-table-column>
              
              <el-table-column label="指标文号" prop="corBgtDocNoName" width="120" align="center" />
              <el-table-column label="指标总金额" width="120" align="center">
                <template slot-scope="{row}">
                  <span style="float: right">{{ Number(row.aviamt).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,") }}</span>
                </template>
              </el-table-column>
              <el-table-column label="剩余指标" width="120" align="center">
                <template slot-scope="{row}">
                  <span style="float: right">{{ Number(row.canuseamt).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,") }}</span>
                </template>
              </el-table-column>
              <el-table-column label="支付方式" prop="payTypeName" width="120" align="center" />
              <el-table-column label="功能分类编码" prop="expFuncCode" width="120" align="center" />
              <el-table-column label="功能分类名称" prop="expFuncName" width="120" align="center" />
              <el-table-column label="资金性质" prop="fundTypeName" width="120" align="center" />
              <el-table-column label="经济分类编码" prop="depBgtEcoNo" width="120" align="center" />
              <el-table-column label="经济分类名称" prop="depBgtEcoName" width="120" align="center" />
              <el-table-column label="预算项目" prop="proName" width="120" align="center" />
              <el-table-column label="单位编码" prop="agency_code" width="120" align="center" />
              <el-table-column label="单位名称" prop="agencyName" width="120" align="center" />
              <el-table-column label="支出类别" prop="pay_category_name" width="120" align="center" />
              <el-table-column label="指标ID" prop="bgtId" align="center" />
              <el-table-column fixed="right" label="操作" width="100">
                <template slot-scope="scope">
                  <el-button type="text" size="small" @click="handleDeleteClick(scope.row)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
          </el-col>
        </el-row>
        <el-row>
          <el-col style="text-align: center; margin-top:2%">
            <el-button type="primary" :loading="saveLoading" @click="handleSaveHookUpData">
              确定
            </el-button>
            <el-button @click="hookUpFormVisible = false">
              取消
            </el-button>
          </el-col>
        </el-row>
      </el-form>
    </el-dialog>
  </div>
</template>
<script>
import { queryAgencySalaryPaymentPage, queryAgencyIndexPage, saveHookUpData,
  getHookUpData,getPaymentLock } from '@/api/thirteen/connectIndex'
import { getPayType, getProCat, getDepBgtEco, getPayCategory, getBaseDataFunc, getGovBgtEcoTree } from '@/api/baseInfo'
import Pagination from '@/components/Pagination' // secondary package based on el-pagination
import tableEmpty from '@/components/table/empty'
import AgencyTree from '@/components/tree/agencyTree'
import Drag from '@/components/Drag'
export default {
  name: 'Index',
  components: { Pagination, tableEmpty, AgencyTree, Drag },
  filters: {
    usingFilter(type) {
      if (type === '1') {
        return '启用'
      } else if (type === '0') {
        return '停用'
      }
    }
  },
  data() {
    return {
      treeHeight: null,
      isActive: true,
      Show: false,
      treeShow: false,
      treeData: '',
      tableHeight: null,
      list: [],
      total: 0,
      listLoading: true,
      listQuery: {
        page: 1,
        limit: 200,
        agencyId: '0'
      },
      payTypeLists: [], // 支付方式
      proCatLists: [], // 项目分类
      proLists: [], // 预算项目
      depBgtEcoLists: [], //部门经济科目
      govBgtEcoLists: [],// 政府经济分类
      funcLists:[],
      payCategoryLists: [{ 'id': '11', 'label': '统发工资经费' }], // 工资类别
      hookUpFormVisible: false,
      indexLoading: false,
      usingList: [{ 'code': '1', 'name': '启用' }, { 'code': '0', 'name': '停用' }],
      indexList: [],
      indexTotal: 0,
      defaultProps: {
        id: 'id',
        children: 'children',
        label: 'label'
      },
      defaultExpandedKey: [],
      defaultPayExpandedKey: [11],
      formData: {
        offset: 1,
        limit: 200,
        payTypeCode: '',
        proCatCode: '',
        proCode: '',
        corBgtDocNoName: '',//指标文号
        depBgtEcoCode: '',
        payCategoryCode: '',
        funcCode:'',
        agencyId: ''
      },
      depBgtEcoName: '',
      payCategoryName: '',
      funcName:'',
      hookUpQuery: {
        salaryId: '',
        personType: '',
        agencyId: ''
      },
      paymentLock: {
        agencyId: ''
      },
      hookUpLoading: false,
      saveLoading: false,
      selection: [],
      hookUpList: [],
      paymentLockList: [],
      checkSumIdList: []
    }
  },
  watch: {
    list(val) {
      this.doLayout()
    }
  },
  created() {
    this.getList()
    this.initBaseInfo()
  },
  mounted() {
    this.getTbHeight()
    this.dragController()
  },
  beforeMount() {
    window.addEventListener('resize', this.getTbHeight)
  },

  methods: {
    // 拖拽
    dragController() {
      this.$refs.icon.dragControllerDiv()
    },
    toggerTree() {
      this.treeShow = !this.treeShow
      this.isActive = !this.isActive
      this.Show = !this.Show
    },
    getFirstAuthAgencyData(data) {
      this.treeData = data
      this.handleTree(data)
    },
    handleTreeQuery(data) {
      this.treeData = data
      this.handleTree(data)
    },
    handleTree(data) {
      if (data.isleaf === '1') {
        this.listQuery.agencyId = data.id
        this.getList()
      }
    },
    /* 重新渲染table组件 */
    doLayout() {
      this.$nextTick(() => {
        this.$refs.singalTable.doLayout()
      })
    },
    // 获取table高度的方法
    getTbHeight() {
      this.tableHeight = window.innerHeight - 228
      this.treeHeight = window.innerHeight - 228
    },
    getList() {
      this.listLoading = true
      queryAgencySalaryPaymentPage(this.listQuery).then(response => {
        // 求和
        let result = [];
        response.data.rows.forEach(a => {
          if (!result.some(item => item.salaryBaseName === a.salaryBaseName && item.personStateName === a.personStateName )) {
            result.push(a)
          } else {
            result.map(item => {
              if (item.salaryBaseName === a.salaryBaseName && item.personStateName === a.personStateName) {
                item.aviamt = Number(item.aviamt)+  Number(a.aviamt)
                item.canuseamt =  Number(item.canuseamt) +  Number(a.canuseamt)
              }
            })
          }
        });
        this.list = result;
        //this.list = response.data.rows // 打开求和，就注销这一句
       // this.total = response.data.total
        this.total =this.list.length
        this.listLoading = false
      })
    },
    handleQuery() {
      this.listQuery.page = 1
      // this.listQuery.limit = 10
      this.getList()
    },
    // 指标挂接之前看是否有冻结指标
      handleHookUp(){
         this.selection = this.$refs.singalTable.selection
           if (this.selection.length !== 1) {
             this.$message({
             showClose: true,
             message: '请选择一条要挂接的工资项',
             type: 'warning',
             duration: 4000
          })
          return
       }
        this.formData.payTypeCode= ''
        this.formData.proCatCode= ''
        this.formData.proCode= ''
        this.formData.corBgtDocNoName= ''
        this.formData.depBgtEcoCode= ''
        this.formData.payCategoryCode= ''
        this.formData.funcCode=''
        this.depBgtEcoName= ''
        this.payCategoryName= ''
        this.funcName=''
        this.paymentLock.agencyId=this.selection[0].agencyId
      //   getPaymentLock(this.paymentLock).then((response) => {
      //   this.paymentLockList = response.data
      //   if(this.paymentLockList.length > 0){
      //     this.$message({
      //     showClose: true,
      //     message: '指标已冻结不可操作',
      //     type: 'warning',
      //     duration: 4000
      //   })
      //   return
      // }else(
        //调用指标挂接方法
       this.handleHookUpChildren()
      //  )
      // })
      
      },
      /**
       * 指标挂接方法
       */
    handleHookUpChildren() {
      this.selection = []
      this.selection = this.$refs.singalTable.selection
      this.indexList = []
      this.indexTotal = 0
      this.hookUpList = []
      this.checkSumIdList = []
      this.hookUpFormVisible = true
      this.hookUpQuery.salaryId = this.selection[0].salaryId
      this.hookUpQuery.personType = this.selection[0].personType
      this.hookUpQuery.agencyId = this.selection[0].agencyId
      this.formData.agencyId = this.selection[0].agencyId
      // 获取已挂接的指标
      this.getHookUpData()
    },
    getHookUpData() {
      this.hookUpLoading = true
      getHookUpData(this.hookUpQuery).then((response) => {
        this.hookUpList = response.data
        this.hookUpList.forEach(item => {
          this.checkSumIdList.push(item.bgtId)
        })
        this.hookUpLoading = false
      })
    },
    // 查询预算指标表格数据
    getIndexList() {
      this.indexLoading = true
      queryAgencyIndexPage(this.formData).then((response) => {
        this.indexList = response.data.rows
        this.indexTotal = response.data.total
        this.$nextTick(() => {
          if (this.checkSumIdList.length > 0) {
            this.indexList.forEach(row => {
              if (this.checkSumIdList.indexOf(row.bgtId) >= 0) {
                this.$refs.indexTable.toggleRowSelection(row, true)
              }
            })
          }
        })
        this.indexLoading = false
      })
    },
    // 查询预算指标表数据
    handleQueryIndexList() {
      this.formData.offset = 1
      this.formData.limit = 200
      this.getIndexList()
    },
    handleAllChecked(rows) { // 全选事件
      const _that = this
      if (rows.length === 0) {
        const rows2 = _that.indexList

        rows2.forEach(function(item) {
          _that.handleDeleteClick(item) // 删除
        })
      }
      rows.forEach(function(item) {
        _that.handleIndexChecked(rows, item)
      })
    },
    // 预算指标表点击复选框事件
    handleIndexChecked(rows, row) {
      // 如果rows有值，则进行判断，如果没有，直接删除row数据
      if (rows.length > 0) {
        // 如果rows里不包含当前选中的行数据，则为删除数据；否则为增加数据
        if (rows.indexOf(row) < 0) {
          if (this.hookUpList.length > 0) {
            for (const index in this.hookUpList) {
              if (this.hookUpList[index]['bgtId'] === row.bgtId) {
                this.hookUpList.splice(index, 1)
              }
            }
          }
          const checkedIndex = this.checkSumIdList.indexOf(row.bgtId)
          this.checkSumIdList.splice(checkedIndex, 1)
        } else {
          // 判断已挂接的是否存在选中的数据，如果不存在则添加
          let flag = false
          this.hookUpList.forEach(item => {
            if (item.bgtId === row.bgtId) {
              flag = true
            }
          })
          if (!flag) {
            this.hookUpList.push(row)
            this.checkSumIdList.push(row.bgtId)
          }
        }
      } else {
        const index = this.hookUpList.indexOf(row)
        this.hookUpList.splice(index, 1)
        const checkedIndex = this.checkSumIdList.indexOf(row.bgtId)
        this.checkSumIdList.splice(checkedIndex, 1)
      }
    },
    // 删除挂接表数据
    handleDeleteClick(row) {
      // 预算指标表的bgtId和删除的bgtId相同时，取消预算指标表的复选框
      const indexTableData = this.$refs.indexTable.tableData
      indexTableData.forEach(item => {
        if (item.bgtId === row.bgtId) {
          this.$refs.indexTable.toggleRowSelection(item, false)
        }
      })
      // 删除存储的挂接表数据
      const index = this.hookUpList.indexOf(row)
      this.hookUpList.splice(index, 1)
      const checkedIndex = this.checkSumIdList.indexOf(row.bgtId)
      this.checkSumIdList.splice(checkedIndex, 1)
    },
    // 保存
    handleSaveHookUpData() {
      this.saveLoading = true
      const hookUpData = this.$refs.hookUpTable.tableData
      this.selection[0]['bgtInfos'] = hookUpData
      if(this.selection[0].bgtInfos.length==0){
        this.$message({
          showClose: true,
          message: '请选择指标',
          type: 'warning',
          duration: 4000
        })
        this.saveLoading = false
        return
      }
      saveHookUpData(this.selection[0]).then((response) => {
        this.$message({
          showClose: true,
          message: '保存成功',
          type: 'success',
          duration: 4000
        })
        this.saveLoading = false
        this.hookUpFormVisible = false
        this.handleQuery()
      }).catch(() => {
        this.saveLoading = false
      })
    },
    // 树点击
    handleNodeClick(data) {
      if (data.isleaf === '1') {
        this.formData.depBgtEcoCode = data.code
        this.depBgtEcoName = data.label
        this.$refs.selectReport.blur()
      }
    },
     // 树点击
    handleFuncNodeClick(data) {
      if (data.isleaf === '1') {
        this.formData.funcCode = data.code
        this.funcName = data.label
        this.$refs.selectReport.blur()
      }
    },
    // 清除下拉树选中
    clearHandle() {
      this.depBgtEcoName = ''
      this.formData.depBgtEcoCode = ''
      this.defaultExpandedKey = []
    },
    // 清除下拉树选中
    clearFuncHandle() {
      this.funcName = ''
      this.formData.funcCode = ''
      this.defaultExpandedKey = []
    },
    // 树点击
    handlePayNodeClick(data) {
      if (data.isleaf === '1') {
        this.formData.payCategoryCode = data.code
        this.payCategoryName = data.label
        this.$refs.selectPayReport.blur()
      }
    },
    // 清除工资类别下拉树
    clearPayHandle() {
      this.payCategoryName = ''
      this.formData.payCategoryCode = ''
      this.defaultPayExpandedKey = []
    },
    // 初始化基础数据
    initBaseInfo() {
      // 支付方式
      getPayType().then((response) => {
        this.payTypeLists = Object.assign({}, response.data)
      })
      // 项目分类
      getProCat().then((response) => {
        this.proCatLists = Object.assign({}, response.data)
      })
      // 预算项目
      // getPro().then((response) => {
      //   this.proLists = Object.assign({}, response.data)
      // })
       // 支出功能分类科目
      getBaseDataFunc().then((response) => {
        this.funcLists = response.data
      })
      //部门经济分类
      getDepBgtEco().then((response) => {
        this.depBgtEcoLists = response.data
      })
      // 工资类别
      getPayCategory().then((response) => {
        this.payCategoryLists = response.data
      })
      //政府性经济科目树
      getGovBgtEcoTree().then((response) => {
        this.govBgtEcoLists = response.data
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.cell-input{
  width: 80%;
}
::v-deep .indexTable {
  .el-table__header-wrapper {
     .el-checkbox {
      display: none;
    }
  }

}
::v-deep.hookUpTable {
  .el-input{
    width: auto !important;
  }
}
::v-deep.el-select-dropdown__item.selected {
  font-weight: normal;
}
</style>
